#!/bin/sh

echo "test"

code_dir=$1

cd $code_dir
#check account
grep -w -E "[a-z][0-9]{8}|[a-z]wx[0-9]{6}" * -R > ./search_result

#check email
grep -E ".*@huawei.com" * -R >> ./search_result

#check DTS
grep -E "DTS2019[0-9]{9}" * -R >> ./search_result

#check AR/SR
grep -E "S[1-9][0-9]{4}|AR\..*|SR\..*" * -R >> ./search_result

if [ -s ./search_result ];then
    echo "***********************************************************************************************************"
    echo "There is some information related to  accounts or emails in files committed; Please delete it, then go on."
    echo "*********************"
    cat ./search_result
    echo "***********************************************************************************************************"
fi
